<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/4/15
  Time: 0:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>用户中心</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/reset.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/shiwumain.css">
    <link href="${pageContext.request.contextPath}/css/houtaimain.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/bstable/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/bstable/css/bootstrap-table.css" rel="stylesheet" type="text/css">
</head>
<body>

<div class="search_bar clearfix">

    <div class="sub_page_name fl">|&nbsp;&nbsp;&nbsp;&nbsp;用户中心</div>
    <div class="search_con fr">
        <form  action="${pageContext.request.contextPath}/product/queryByName" method="post">
        <input type="text" class="input_text fl" name="p_name" placeholder="搜索商品">
        <input type="submit" class="input_btn fr"  value="搜索">
        </form>
    </div>
</div>

<div class="main_con clearfix">

    <div class="left_menu_con clearfix">
        <h3>用户中心</h3>
        <ul>
            <li><a href="${pageContext.request.contextPath}/user/info" class="active">· 个人信息</a></li>
            <li><a href="${pageContext.request.contextPath}/user_info/updata_password" class="active">· 修改密码</a></li>
            <li><a href="${pageContext.request.contextPath}/favorite/user_favorite" class="active">· 收藏列表</a></li>
            <li><a href="${pageContext.request.contextPath}/product/getProductByUserId" class="active">· 发布的闲置商品</a></li>
            <li><a href="${pageContext.request.contextPath}/lostProduct/getLostProductByUserId" class="active">· 发布的失物招领信息</a></li>

        </ul>
    </div>
    <div class="right_content clearfix">
        <h3 style="line-height: 20px;font-size: 16px;">当前位置:<a href="${pageContext.request.contextPath}/index/ToIndex" >首页</a>><a href="${pageContext.request.contextPath}/product/toShop"> 闲置物品</a>><a href="*">个人中心</a> <a href="*"> >已发布的商品列表</a> </h3>


        <table id="table" >
                 <c:forEach items="${favorites}" var="favorites">
            <tr>
                <td width="55%">
                    <ul class="order_goods_list clearfix">
                        <li class="col01"><img src="${favorites.product.photo}"></li>
                        <li class="col02" style="font-size: 15px">${favorites.product.p_name} <em><a onclick="if(confirm('确定要删除该记录吗?')){return true;}else{return false;}" href="${pageContext.request.contextPath}/favorite/delete?fid=${favorites.fid}" >删除</a></em></li>
                        <li class="col02"  style="font-size: 15px">收藏时间：${favorites.time}</li>
                    </ul>

                </td>
                <td width="10%"style="font-size: 15px">${favorites.product.price}元</td>
                <td width="20%"style="font-size: 15px">联系电话：${favorites.product.phone}</td>
                <td width="15%"style="font-size: 15px"><a href="${pageContext.request.contextPath}/product/getProductById?pid=${favorites.product.pid}" class="oper_btn">查看详情</a></td>
            </tr>
                 </c:forEach>

        </table>


        <div></div>
        <script src="${pageContext.request.contextPath}/js/jquery.js"></script>
        <script src="${pageContext.request.contextPath}/js/date/js/laydate.js"></script>
        <script src="${pageContext.request.contextPath}/bstable/js/bootstrap.min.js"></script>
        <script src="${pageContext.request.contextPath}/bstable/js/bootstrap-table.js"></script>
        <script src="${pageContext.request.contextPath}/bstable/js/bootstrap-table-zh-CN.min.js"></script>
        <script>
            !function () {
                laydate.skin('danlan'); //切换皮肤，请查看skins下面皮肤库
                laydate({ elem: '#demo' });
                laydate({ elem: '#demo1' }); //绑定元素
            } ();
        </script>

        <script type="text/javascript">
            $(function() {
                $('#table')
                    .bootstrapTable({
                        method: "get",
                        striped: true,
                        singleSelect: false,

                        dataType: "json",
                        pagination: true, //分页
                        pageSize: 2,
                        pageNumber: 1,
                        search: false, //显示搜索框
                        contentType: "application/x-www-form-urlencoded",
                        queryParams: null,
                        columns: [
                            {
                                title: "",
                                field: 'id',
                                align: 'center',
                                valign: 'middle',

                            },
                            {
                                title: '',
                                field: 'name',
                                align: 'center',
                                valign: 'middle'
                            },


                            {
                                title: '',
                                field: 'star',
                                align: 'center',
                                valign: 'middle'
                            },
                            {
                                title: '',
                                field: 'buildTime',
                                align: 'center',
                                valign: 'middle'
                            }


                        ]
                    });
            });


        </script>
        <script src="layer_v2.1/layer/layer.js"></script>
        <script type="text/javascript">
            function openlayer(id) {
                layer.open({
                    type: 2,
                    title: '添加信息',
                    shadeClose: true,
                    shade: 0.5,
                    skin: 'layui-layer-rim',
                    //            maxmin: true,
                    closeBtn: 1,
                    area: ['80%', '75%'],
                    shadeClose: true,
                    closeBtn: 1,
                    content: 'addHotel.html'
                    //iframe的url
                });
            }

            //    function editHotel(id) {


            function deleteHotel(dom) {
                alert("删除成功");
                $(dom).parent().parent().remove();
            }

            function showHotelInfo(id)
            {
                layer.open({
                    type: 2,
                    title: '酒店信息',
                    shadeClose: true,
                    shade: 0.5,
                    skin: 'layui-layer-rim',
                    //            maxmin: true,
                    closeBtn: 1,
                    area: ['80%', '75%'],
                    shadeClose: true,
                    closeBtn: 1,
                    content: 'addHotel.html'
                    //iframe的url
                });
            }
        </script>
</body>
</html>
